//导入express
const express=require("express");
//创建一个wed服务器
const app=express();
const cors=require("cors");
app.use(cors());

const router=require("./router/userapi.js");
// ===静态托管===
app.use(express.static('./pages'))
// ===解决请求实体太大===
app.use(express.json({ limit: '50mb' }));
// =====解析post请求=====
app.use(express.urlencoded({ extended: false,limit: '50mb' }));

app.use("/api",router);
app.listen(3001,()=>{
    console.log('启动1231端口号app server');
});